<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    pageContext.setAttribute("basePath", basePath);
    String appid = request.getParameter("appid");
    request.setAttribute("appid", appid);
    String uuid = request.getParameter("uuid");
    request.setAttribute("uuid", uuid);
    String type = request.getParameter("type");
    request.setAttribute("type", type);
%>

<html>
<head>
    <%@include file="../common/base.jsp" %>
    <meta charset="utf-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <link rel="stylesheet" href="${base}/admin/css/mobiscroll.custom-3.0.0-beta6.min.css"/>
    <link rel="stylesheet" href="${base}/admin/css/reset.css?v=1.4" type="text/css"/>
    <link rel="stylesheet" href="${base}/admin/js/toastr/toastr.css?edition=${edition}" type="text/css"/>
    <link rel="stylesheet" href="${base}/admin/css/Mdate.css"/>
    <title>司机申请</title>
    <script>
        window.appid = "${appid}";
    </script>
    <style>
        .ui-toastr-layer {
            position: fixed;
            left: 0;
            top: 0;
            height: 100%;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 120;
        }

        body {
            background: #FFF;
        }

        .select-dricer__type {
            padding: 0.08rem;
            display: none;
        }

        .select-dricer__type.visible {
            display: block;
        }

        .select-dricer__bk {
            height: 1.4rem;
            background-size: 100% 100%;
        }

        .select-dricer--have-car {
            background-image: url('${base}/admin/images/pic_havecar@2x.png');
        }

        .select-dricer--no-car {
            background-image: url('${base}/admin/images/pic_notcar@2x.png');
        }

        .select-dricer__bk h3 {
            font-size: 20px;
            color: #4F5A67;
            line-height: 0.28rem;
            padding: 0.23rem 0 0 0.23rem;
            position: relative;
        }

        .select-dricer__bk h3:after {
            content: '';
            position: absolute;
            bottom: 50%;
            margin-left: 0.1rem;
            margin-bottom: -0.18rem;
            background: url('${base}/admin/images/icon_go_gray@2x.png');
            background-size: 100% 100%;
            height: 0.16rem;
            width: 0.16rem;
        }

        .select-dricer__bk p {
            font-size: 14px;
            color: #9EA7B1;
            line-height: 0.24rem;
            padding: 0 0 0 0.23rem;
        }

        .ui-btn {
            width: calc(100% - 0.3rem);
            bottom: 0.15rem;
            display: block;
            box-sizing: border-box;
            font-size: 14px;
            line-height: 0.45rem;
            text-align: center;
            text-decoration: none;
            color: #FFFFFF;
            border-radius: 2px;
            background-color: #171720;
            margin: 0 auto;
        }

        .upload-tip-area .ui-btn {
            width: auto;
            position: unset;
        }

        .step-apply-area {
            position: unset !important;
            padding-bottom: 0.6rem;
            background: #FFF;
        }

        .step-apply__content {

        }

        .step-apply__button {

        }

        /*第二部认证显示*/

        .step-apply-area, .preview-area, .step-one {
            display: none;
            position: relative;
            padding: 0;
        }

        .step-apply-area.visible, .preview-area.visible, .step-one.visible {
            display: block;
        }

        .ui-step-area {
            display: block;
            padding: 0.19rem 0.15rem;
            position: relative;
            margin: 0;
        }

        .ui-step-area:after {
            content: '';
            position: absolute;
            width: calc(100% - 0.3rem);
            height: 1px;
            background: #DCDFE3;
            left: 50%;
            margin-left: calc(-50% + 0.15rem);
            bottom: 0;
        }

        .ui-step-area h4 {
            color: #4F5A67;
            font-size: 16px;
            line-height: 0.23rem;
            display: block;
        }

        .ui-step-area p {
            color: #4F5A67;
            font-size: 14px;
            line-height: 0.17rem;
        }

        .ui-form {
            padding: 0.15rem;
        }

        .form-group .control-label {
            color: #4F5A67;
            font-size: 14px;
        }

        .form-group .txt-gray {
            font-size: 12px;
            color: #9EA7B1;
            padding-left: 8px;
        }

        .file-img, .ui-form .form-control[type="file"] {
            height: 1.5rem;
        }

        .file-head {
            height: 1.15rem;
            width: 1.15rem;
        }

        .file-head .ui-form .form-control[type="file"] {
            height: 1.15rem;
        }

        .file-img {
            position: relative;
        }

        .file-img img.file-img-bk {
            height: 1.5rem !important;
        }

        .file-img .error {
            position: absolute;
            bottom: 4px;
            left: 4px;
        }

        .select-container {
            position: relative;
        }

        .select-container:after {
            content: '';
            position: absolute;
            right: 0.08rem;
            top: 50%;
            margin-top: -0.04rem;
            background: url('${base}/admin/images/nav_icon_pulldown_selected@2x.png') no-repeat;
            background-size: 100% 100%;
            width: 0.12rem;
            height: 0.06rem;
        }

        .ui-back-btn {
            padding: 0 15px;
            background: #fff;
            font-size: 33px;
            margin-bottom: 0;
            line-height: 28px;
        }

        .upload-tip-area {
            z-index: 98;
        }

        .upload-tip-area .tip-area {
            z-index: 99;
        }
    </style>
</head>
<body>
<!-- 注册司机类型选择 -->
<div class="select-dricer__type visible">
    <div class="select-dricer__bk select-dricer--have-car" data-type="1">
        <h3>带车司机加入</h3>
        <p>优质订单，自有订单，轻松赚钱</p>
    </div>
    <div class="select-dricer__bk select-dricer--no-car" data-type="0">
        <h3>无车司机加入</h3>
        <p>可租/可买合规车辆，自由接单</p>
    </div>
</div>


<!--司机申请第一步-->
<div class="step-apply-frist step-apply-area">
    <div class="step-apply__content">
        <div class="ui-back-btn" data-step=".select-dricer__type"><span>&#139</span></div>
        <div class="ui-step-area">
            <h4>第一步 个人信息</h4>
            <p>为保证出行安全，请务必填写本人真实信息</p>
        </div>
        <div class="ui-form" id="first-next">
            <form name="step-first" class="step-first">
                <input type="hidden" value="${appid}" name="appid">
                <input type="hidden" value="${agentUuid}" name="agentUuid">
                <input type="hidden" value="${companyUuid}" name="companyUuid">
                <input type="hidden" value="${type}" name="type">
                <input type="hidden" value="${type}" name="bussinessType"/>
                <input type="hidden" value="${driverCheckDto.licenseNum}" name="licenseNum"/>

                <div class="form-group">
                    <label class="control-label">手机号码</label>
                    <div>
                        <input type="text" name="mobile" value="${mobile}" readonly class="form-control"
                               placeholder="请填写手机号"
                               data-rule-required="true" data-rule-phone="true" data-msg-required="请填写手机号"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">真实姓名</label>
                    <div>
                        <input type="text" name="name" value="${driverCheckDto.name}" class="form-control"
                               placeholder="请填写真实姓名"
                               data-rule-required="true" data-msg-required="请填写真实姓名"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">身份证号</label>
                    <div>
                        <input type="text" name="idCard" value="${driverCheckDto.idCard}" maxlength="18"
                               class="form-control"
                               placeholder="请填写18位身份证号" data-rule-required="true" data-rule-license="true"
                               data-msg-license="请填写18位身份证号"
                               data-msg-required="请填写18位身份证号"/>
                    </div>
                </div>
                <!-- 所在城市省 -->
                <div class="form-group">
                    <label class="control-label">省</label>
                    <div class="select-container">
                        <select id="provinceid" name="provinceid" type="text" class="form-control"
                                placeholder="请选择在省份"
                                data-rule-required="false" data-msg-required="请选择所在省份">
                            <!-- 异步渲染所属省列表 -->
                        </select>
                    </div>
                </div>
                <!-- 所在城市区县 -->
                <div class="form-group">
                    <label class="control-label">区县</label>
                    <div class="select-container">
                        <select id="cityid" name="cityid" type="text" class="form-control" placeholder="请选择在区县"
                                data-rule-required="false" data-msg-required="请选择所在区县">
                            <!-- 异步渲染所属区县列表 -->
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">驾驶证日期</label>
                    <div>
                        <input readonly type="text" id="getDriverLicenseDate" name="getDriverLicenseDate"
                               class="form-control" placeholder="请选择驾驶证的注册日期"
                               data-msg-required="请选择驾驶证日期"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">网络预约出租车司机资格证号</label>
                    <div>
                        <input type="text" name="certificateNo" value="${driverCheckDto.certificateNo}" maxlength="30"
                               class="form-control"
                               placeholder="请填写网络预约出租车司机资格证号" data-rule-required="false""
                        data-msg-required="网络预约出租车司机资格证号" />
                    </div>
                </div>
                <!-- 所属区域 -->
                <div class="form-group">
                    <label class="control-label">所属代理</label>
                    <div class="select-container">
                        <select id="agentUuid" name="agentUuid" type="text" class="form-control"
                                placeholder="请选择所属区域"
                                data-rule-required="false" data-msg-required="请选择所属区域">
                            <!-- 异步渲染所属区域列表 -->
                        </select>
                    </div>
                </div>
                <!-- 所属公司 -->
                <div class="form-group">
                    <label class="control-label">所属公司</label>
                    <div class="select-container">
                        <select id="companyUuid" name="companyUuid" type="text" class="form-control"
                                placeholder="请选择所属公司"
                                data-rule-required="false" data-msg-required="请选择所属公司">
                            <!-- 异步渲染所属公司列表 -->
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">头像<span class="txt-gray">点击图片重新上传</span></label>
                    <div>
                        <div class="file-img file-head" id="face"
                             style="background-image: url('${website}${driverCheckDto.face}')">
                            <input class="file-input" type="text" name="face" value="${driverCheckDto.face}"
                                   data-rule-required="true" data-msg-required="请上传图片"/>
                            <input type="file" id="face-btn" name="face-btn" multiple="multiple"
                                   class="form-control file-btn"
                                   placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"
                                 style="width: 1.15rem !important;height: 1.15rem  !important;object-fit: cover;"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">身份证照片<span class="txt-gray">点击图片重新上传</span></label>
                    <div>
                        <!-- 身份证正面 -->
                        <div class="file-img" id="idCardFaceImg"
                             style="background-image: url('${website}${driverCheckDto.idCardFaceImg}')">
                            <input class="file-input" type="text" name="idCardFaceImg"
                                   value="${driverCheckDto.idCardFaceImg}"
                                   data-rule-required="true" data-msg-required="请上传图片"/>
                            <input type="file" id="idCardFaceImg-btn" name="idCardFaceImg-btn" multiple="multiple"
                                   class="form-control file-btn"
                                   placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                        </div>
                        <!-- 身份证反面 -->
                        <div class="file-img" id="idCardBackImg"
                             style="background-image: url('${website}${driverCheckDto.idCardBackImg}')">
                            <input class="file-input" type="text" name="idCardBackImg"
                                   value="${driverCheckDto.idCardBackImg}"
                                   data-rule-required="true" data-msg-required="请上传图片"/>
                            <input type="file" id="idCardBackImg-btn" name="idCardBackImg-btn" multiple="multiple"
                                   class="form-control file-btn"
                                   placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">手持身份证<span class="txt-gray">点击图片重新上传</span></label>
                    <div>
                        <!-- 	手持身份证 -->
                        <div class="file-img" id="fullDriverIdCardImg"
                             style="background-image: url('${website}${driverCheckDto.fullDriverIdCardImg}')">
                            <input class="file-input" type="text" name="fullDriverIdCardImg"
                                   value="${driverCheckDto.fullDriverIdCardImg}"
                                   data-rule-required="true" data-msg-required="请上传图片"/>
                            <input type="file" id="fullDriverIdCardImg-btn" name="fullDriverIdCardImg-btn"
                                   multiple="multiple" class="form-control file-btn"
                                   placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">驾驶证照片<span class="txt-gray">点击图片重新上传</span></label>
                    <div>
                        <!--  驾驶证正页 -->
                        <div class="file-img" id="drivingLicenceHomeImg"
                             style="background-image: url('${website}${driverCheckDto.drivingLicenceHomeImg}')">
                            <input class="file-input" type="text" name="drivingLicenceHomeImg"
                                   value="${driverCheckDto.drivingLicenceHomeImg}"
                                   data-rule-required="true" data-msg-required="请上传图片"/>
                            <input type="file" id="drivingLicenceHomeImg-btn" name="drivingLicenceHomeImg-btn"
                                   multiple="multiple" class="form-control file-btn"
                                   placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                        </div>
                        <!-- 驾驶证副页 -->
                        <div class="file-img" id="drivingLicenceSubImg"
                             style="background-image: url('${website}${driverCheckDto.drivingLicenceSubImg}')">
                            <input class="file-input" type="text" name="drivingLicenceSubImg"
                                   value="${driverCheckDto.drivingLicenceSubImg}"
                                   data-rule-required="true" data-msg-required="请上传图片"/>
                            <input type="file" id="drivingLicenceSubImg-btn" name="drivingLicenceSubImg-btn"
                                   multiple="multiple" class="form-control file-btn"
                                   placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">网络预约出租车司机资格证照片<span
                            class="txt-gray">点击图片重新上传</span></label>
                    <div>
                        <div class="file-img" id="networkCarCertificationImg"
                             style="background-image: url('${website}${driverCheckDto.networkCarCertificationImg}')">
                            <input class="file-input" type="text" name="networkCarCertificationImg"
                                   value="${driverCheckDto.networkCarCertificationImg}"
                                   data-rule-required="false" data-msg-required="请上传图片"/>
                            <input type="file" id="networkCarCertificationImg-btn" name="networkCarCertificationImg-btn"
                                   multiple="multiple"
                                   class="form-control file-btn" placeholder="请上传图片" hidden/>
                            <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="step-apply__button">
        <div class="ui-btn frist-step-btn" href="javascript:void(0);">保存</div>
    </div>
</div>

<!--司机申请第二步-->
<div class="step-apply-second step-apply-area">
    <div class="ui-back-btn" data-step=".step-apply-frist"><span>&#139</span></div>
    <div class="ui-step-area">
        <h4>第二步 车辆信息</h4>
        <p>为保证出行安全，请务必填写车辆信息</p>
    </div>
    <div class="ui-form">
        <form name="step-second" class="step-second">
            <div class="form-group">
                <label class="control-label">车牌号码</label>
                <div>
                    <input type="text" name="plateNum" value="${driverCheckDto.plateNum}" maxlength="18"
                           class="form-control"
                           placeholder="请输入车牌号码" data-rule-required="true" data-msg-required="请输入车牌号码"/>
                </div>
            </div>
            <%--            <div class="form-group">--%>
            <%--                <label class="control-label">车辆所有人</label>--%>
            <%--                <div>--%>
            <%--                    <input type="text" name="ownerName" value="${driverCheckDto.ownerName}" maxlength="18" class="form-control"--%>
            <%--                           placeholder="请输入车辆所有人" data-rule-required="true" data-msg-required="请输入车辆所有人" />--%>
            <%--                </div>--%>
            <%--            </div>--%>
            <%--            <div class="form-group">--%>
            <%--                <label class="control-label">车辆所有人电话</label>--%>
            <%--                <div>--%>
            <%--                    <input type="text" name="ownerNameMobile" value="${driverCheckDto.ownerNameMobile}" maxlength="11" class="form-control"--%>
            <%--                           placeholder="请输入车辆所有人电话" data-rule-phone="true" data-rule-required="true" data-msg-required="请输入车辆所有人电话" />--%>
            <%--                </div>--%>
            <%--            </div>--%>
            <div class="form-group">
                <label class="control-label">车辆品牌</label>
                <div>
                    <input type="text" name="brand" value="${driverCheckDto.brand}" maxlength="18" class="form-control"
                           placeholder="请输入车辆品牌"
                           data-rule-required="true" data-msg-required="请输入车辆品牌"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">车辆型号</label>
                <div>
                    <input type="text" name="model" value="${driverCheckDto.model}" maxlength="18" class="form-control"
                           placeholder="请输入车辆型号"
                           data-rule-required="true" data-msg-required="请输入车辆型号"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">车身颜色</label>
                <div>
                    <input type="text" name="carColor" value="${driverCheckDto.carColor}" maxlength="18"
                           class="form-control"
                           placeholder="请输入车身颜色" data-rule-required="true" data-msg-required="请输入车身颜色"/>
                </div>
            </div>
            <!-- 所属车型 -->
            <div class="form-group">
                <label class="control-label">所属车型</label>
                <div class="select-container">
                    <select id="carModelUuid" name="carModelUuid" type="text" class="form-control"
                            placeholder="请选择所属车型"
                            data-rule-required="true" data-msg-required="请选择所属车型">
                        <!-- 异步渲染所属车型列表 -->
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">核定载客位</label>
                <div>
                    <input type="text" name="seats" value="${driverCheckDto.seats}" number="true" max="9" min="1"
                           class="form-control" placeholder="核定载客位人数由所属车型决定"
                           data-rule-required="true" data-msg-required="请输入核定载客位"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">网络预约出租车辆运输证号</label>
                <div>
                    <input type="text" name="certificate" value="${driverCheckDto.certificate}" maxlength="18"
                           class="form-control"
                           placeholder="请输入网络预约出租车辆运输证号" data-rule-required="false"
                           data-msg-required="请输入网络预约出租车辆运输证号"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">网络预约出租车辆运输证照片<span
                        class="txt-gray">点击图片重新上传</span></label>
                <div>
                    <div class="file-img" id="transLicenseImg"
                         style="background-image: url('${website}${driverCheckDto.transLicenseImg}')">
                        <input class="file-input" type="text" name="transLicenseImg"
                               value="${driverCheckDto.transLicenseImg}"
                               data-rule-required="false" data-msg-required="请上传图片"/>
                        <input type="file" id="transLicenseImg-btn" name="transLicenseImg-btn" multiple="multiple"
                               class="form-control file-btn"
                               placeholder="请上传图片" hidden/>
                        <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">行驶证照片<span class="txt-gray">点击图片重新上传</span></label>
                <div>
                    <div class="file-img" id="drivingPic"
                         style="background-image: url('${website}${driverCheckDto.drivingPic}')">
                        <input class="file-input" type="text" name="drivingPic" value="${driverCheckDto.drivingPic}"
                               data-rule-required="true" data-msg-required="请上传图片"/>
                        <input type="file" id="drivingPic-btn" name="drivingPic-btn" multiple="multiple"
                               class="form-control file-btn"
                               placeholder="请上传图片" hidden/>
                        <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                    </div>
                    <div class="file-img" id="drivingPicBack"
                         style="background-image: url('${website}${driverCheckDto.drivingPicBack}')">
                        <input class="file-input" type="text" name="drivingPicBack"
                               value="${driverCheckDto.drivingPicBack}"
                               data-rule-required="true" data-msg-required="请上传图片"/>
                        <input type="file" id="drivingPicBack-btn" name="drivingPicBack-btn" multiple="multiple"
                               class="form-control file-btn"
                               placeholder="请上传图片" hidden/>
                        <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">车身45度照片<span class="txt-gray">点击图片重新上传</span></label>
                <div>
                    <div class="file-img" id="carAngle45Img"
                         style="background-image: url('${website}${driverCheckDto.carAngle45Img}')">
                        <input class="file-input" type="text" name="carAngle45Img"
                               value="${driverCheckDto.carAngle45Img}"
                               data-rule-required="true" data-msg-required="请上传图片"/>
                        <input type="file" id="carAngle45Img-btn" name="carAngle45Img-btn" multiple="multiple"
                               class="form-control file-btn"
                               placeholder="请上传图片" hidden/>
                        <img class="file-img-bk" src="${base}/admin/images/pic_default2@2x.png"/>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="step-apply__button">
        <div class="ui-btn second-step-btn" href="javascript:void(0);">保存</div>
    </div>
</div>

<!--头像提示-->
<div class="upload-tip-area hide" id="face-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/face.png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>确保头像完整清晰可见</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>

<!--身份证正面提示-->
<div class="upload-tip-area hide" id="idCardFaceImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/driver-ren(4).png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--身份证背面提示-->
<div class="upload-tip-area hide" id="idCardBackImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/driver-ren(3).png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--手持身份证提示-->
<div class="upload-tip-area hide" id="fullDriverIdCardImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/driver-ren(5).png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>确保身份证内容完整清晰可见</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--驾驶证正面照片提示-->
<div class="upload-tip-area hide" id="drivingLicenceHomeImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/driver-ren(2).png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--驾驶证反面照片提示-->
<div class="upload-tip-area hide" id="drivingLicenceSubImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/driver-ren(1).png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--从业资格证照片提示-->
<div class="upload-tip-area hide" id="networkCarCertificationImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/350825199001239999cyzgz.png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--网络预约出租车辆运输证照片提示-->
<div class="upload-tip-area hide" id="transLicenseImg-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/example_pic_transport.png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--行驶证正面照片提示-->
<div class="upload-tip-area hide" id="drivingPic-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/example_pic_travel1.png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--行驶证反面照片提示-->
<div class="upload-tip-area hide" id="drivingPicBack-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/example_pic_travel2.png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保证件信息清晰可见；四角齐全；无反光遮挡</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--车身45度照片提示-->
<div class="upload-tip-area hide" id="carAngle45Img-area">
    <div class="tip-area">
        <p><img src="${base}/admin/images/example_pic_45°car.png"/></p>
        <p>支持得图片格式：jpg、png</p>
        <p>请确保车辆轮廓清晰可见</p>
        <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
    </div>
</div>
<!--保存提示浮层-->
<div class="ui-toastr-layer hide">
    <div class="layer-content">
        <div class="layer-area">
            <p>保存成功！</p>
            <p>车主认证信息会在7个工作日内完成审核，通过即可接单</p>
            <p class="ui-border-top" id="iknow-btn"><a class="txt-orange"> 我知道了</a></p>
        </div>
    </div>
</div>

<script type="text/javascript" src="${base}/js/flexible.js"></script>
<script type="text/javascript" src="${base}/admin/js/iScroll.js"></script>
<script type="text/javascript" src="${base}/admin/js/Mdate.js"></script>
<script type="text/javascript" src="${base}/admin/js/jquery.min-2.2.4.js"></script>
<script type="text/javascript" src="${base}/admin/js/toastr/toastr.js"></script>
<script src="${base}/admin/js/ajaxfileupload.js"></script>
<script src="${base}/admin/js/localResize/LocalResizeIMG.js"></script>
<script src="${base}/admin/js/localResize/mobileBUGFix.mini.js"></script>
<script type="text/javascript" src="${base}/admin/js/mobiscroll/mobiscroll.custom-3.0.0-beta6.min.js"></script>
<script type="text/javascript" src="${base}/admin/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="${base}/activity/giftCollection/js/ajaxUtil.js"></script>
<script type="text/javascript" src="${base}/admin/js/validate/validate.bootstrap.js"></script>
<script type="text/javascript">
    var website = '/imgs' || '${website}'
    var base = '${base}'
    var businessType = '${type}'
    var appid = "${appid}"
    var status = '${driverCheckDto.status}' // （1：待审核、2：审核通过、3：审核失败）
    var haveCar = '${driverCheckDto.haveCar}' // 是否带车0无车 1有车
    var provinceidStart  = '${driverCheckDto.provinceid}'
    // 待审核状态（只可查看）
    if (status == 1) {
        $('.select-dricer__type').removeClass('visible');
        $('.step-apply-frist').addClass('visible');
        $('.form-group input').attr('disabled', true)
        $('.form-group select').attr('disabled', true)
        $('.step-apply-frist .ui-back-btn').hide()
        $('.form-group .txt-gray').hide()
        if (haveCar == 1) {
            $('.frist-step-btn').text('下一步')
            $('.second-step-btn').hide()
        } else if (haveCar == 0) {
            $('.frist-step-btn').hide()
            $('.step-apply-frist .ui-step-area h4').text('个人信息')
        }
    }
    if (status == 3) {
        $('.step-apply-frist .ui-back-btn').hide()
        $('.select-dricer__type').removeClass('visible');
        $('.step-apply-frist').addClass('visible');
        if (haveCar == 1) {
            $('.frist-step-btn').text('下一步')
            $('.step-apply-frist .ui-step-area h4').text('第一步 个人信息')
        } else if (haveCar == 0) {
            $('.frist-step-btn').text('保存')
            $('.step-apply-frist .ui-step-area h4').text('个人信息')
        }
    }
    new Mdate("getDriverLicenseDate", {
        //"dateShowBtn"为你点击触发Mdate的id，必填项
        acceptId: "getDriverLicenseDate",
        //此项为你要显示选择后的日期的input，不填写默认为上一行的"dateShowBtn"
        beginYear: "1980",
        //此项为Mdate的初始年份，不填写默认为2000
        beginMonth: "1",
        //此项为Mdate的初始月份，不填写默认为1
        beginDay: "1",
        //此项为Mdate的初始日期，不填写默认为1
        //endYear: "2017",
        //此项为Mdate的结束年份，不填写默认为当年
        //endMonth: "1",
        //此项为Mdate的结束月份，不填写默认为当月
        //endDay: "1",
        //此项为Mdate的结束日期，不填写默认为当天
        format: "."
        //此项为Mdate需要显示的格式，可填写"/"或"-"或".",不填写默认为年月日
    })
    $('.select-dricer__type .select-dricer__bk').on('click', function () {
        haveCar = $(this).attr('data-type')
        $('.select-dricer__type').removeClass('visible');
        $('.step-apply-frist').addClass('visible');
        if (haveCar === '1') {
            $('.frist-step-btn').text('下一步')
            $('.step-apply-frist .ui-step-area h4').text('第一步 个人信息')
        } else {
            $('.frist-step-btn').text('保存')
            $('.step-apply-frist .ui-step-area h4').text('个人信息')
        }
    })

    try {
        var modelDriverLicenseDate = '${getDriverLicenseDate}'
        var tempDriverLicenseDate = modelDriverLicenseDate ? Number.parseFloat(modelDriverLicenseDate) : ''
        var getDriverLicenseDate = tempDriverLicenseDate || new Date().getTime();
        if (getDriverLicenseDate) {
            var licenseDate = $('#getDriverLicenseDate')
            const tempDate = new Date(getDriverLicenseDate)
            var yearTag = tempDate.getFullYear()
            var monthTag = tempDate.getMonth() + 1
            var dayTag = tempDate.getDate()
            licenseDate.attr("data-year", yearTag);
            licenseDate.attr("data-month", monthTag);
            licenseDate.attr("data-day", dayTag);
            licenseDate.val(yearTag + '.' + monthTag + '.' + dayTag)
        }
    } catch (e) {
        console.error('设置默认日期错误', e)
    }

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    // (function() {
    // 	var uuid = '${uuid}';
    // 	if (uuid == null || uuid == "") {
    // 		return;
    // 	}
    // 	var d = util.localStorage.get(uuid, 'object');
    // 	for (var i in d) {
    // 		$('input[name="' + i + '"]').val(d[i].replace(/^(https|http|ftp|rtsp|mms)?\:\/\/([0-9a-zA-Z\.\:\/]+)images/i, ''));
    // 		$('[data-html="' + i + '"]').html(d[i] || "")
    // 		if (!!d[i]) {
    // 			if ($('#' + i).length > 0) {
    // 				$('#' + i).css('background-image', 'url(' + d[i] + ')')
    // 				$('#' + i + '-pic').attr('src', d[i]);
    // 			}
    // 		}
    // 	}

    // })()
</script>
<script type="text/javascript">
    $(function () {
        //URL获取参数
        // 获取url参数
        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }

        //点击上传图片 ，禁止显示键盘
        $(".file-input").focus(function () {
            document.activeElement.blur();
        });

        //点击上传图片 ，禁止显示键盘
        $(".file-input").focus(function () {
            document.activeElement.blur();
        });

        // 点击照片示例的遮板部分关闭提示弹窗
        $('.upload-tip-area').click(function (e) {
            $(this).hide()
            e.preventDefault()
        })

        //  上传文件方法
        var updataLong =
            '<div class="load-fileImg" style="display: block;"> <p>上传中</p> <div class="load1"></div> <div class="load2"></div> <div class="load3"></div> </div>'

        function updataFile(name) {
            var t = $('#' + name),
                ta = $('#' + name + '-area'),
                tn = $('[name="' + name + '"]'),
                tt = $('input[name="' + name + '"]'),
                tp = $('#' + name + '-pic'),
                tb = $('#' + name + '-btn'),
                tl = $('#' + name + '-load'),
                tbk = $('#' + name + ' .file-img-bk');

            t.on('click', function (e) {
                if (!tt.val()) {
                    ta.show();
                    e.preventDefault()
                }
            });
            // 提示弹窗的操作,触发选择文件
            ta.find('.ui-btn').on('click', function () {
                ta.hide();
                tb.show(); //文件区域show之后，文本区域不在触发弹出示例
                t.unbind('click');
                tb.trigger('click');
            })
            tb.on('change', function (event) {
                // var t=$(this)
                // 判断提交文件是否符合标准
                // alert('change')
                var vel = this.value;
                var size = getPhotoSize(this);
                if (size <= 0) {
                    return;
                }
                if (vel) {
                    if (!/\.(gif|jpen|jpg|jpeg|bmp|png)$/i.test(vel.toLowerCase())) {
                        $.toastr.error("选择文件错误,图片类型必须是gif,jpen,jpg,jpeg,bmp,png中的一种");
                        return;
                    }
                    //                    if(size>2048){//文件大于2M
                    //                        $.toastr.error("图片大小超过2M，请上传小于2M的图片");
                    //                        return;
                    //                    }
                }
                var formData = new FormData();
                formData.append('file', $(this)[0].files[0]);
                formData.append('appid', appid);
                formData.append('mobile', $('input[name="phone"]').val());
                formData.append('imageType', 'avatar');
                //打开遮挡
                t.append(updataLong)
                imgBase64.setOption({
                    files: $(this)[0].files[0],
                    callback: function (img) {
                        var formData = new FormData();
                        formData.append('imageFile', img);
                        formData.append('appid', appid);
                        formData.append('mobile', $('input[name="mobile"]').val());
                        formData.append('imageType', 'avatar');
                        //打开遮挡
                        t.append(updataLong);
                        $.ajax({
                            type: "POST",
                            url: base + '/admin/driver/uploadB64',
                            data: JSON.stringify({
                                'imageFile': img,
                                'appid': appid,
                                'mobile': $('input[name="mobile"]').val(),
                            }),
                            contentType: 'application/json',
                            //                            data:formData,
                            success: function (result) {
                                if (result.success) {
                                    tt.val((result.data).replace(/^(https|http|ftp|rtsp|mms)?\:\/\/([0-9a-zA-Z\.\:\/\-_]+)images/i, ''));
                                    t.css("background-image", "url('" + website + result.data + "')");
                                    tp.attr('src', website + result.data);

                                    //关闭遮挡
                                    t.find('.load-fileImg').remove();
                                    tbk.hide()
                                    $('#' + name + '-error').hide();
                                } else {
                                    //关闭遮挡
                                    t.find('.load-fileImg').remove();
                                    $.toastr.error("上传失败");
                                }
                            },
                            error: function (result, status, e) {
                                //关闭遮挡
                                t.find('.load-fileImg').remove();
                                $.toastr.error("请求异常，请联系管理员");
                            }
                        });
                    }
                })
            });

        }

        //获取文件大小
        function getPhotoSize(obj) {
            var fileSize = 0;
            var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
            if (isIE && !obj.files) {
                var filePath = obj.value;
                var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
                var file = fileSystem.GetFile(filePath);
                fileSize = file.Size;
            } else {
                fileSize = obj.files[0].size;
            }
            fileSize = Math.round(fileSize / 1024 * 100) / 100; //单位为KB
            return fileSize;
        }

        //        需要上传图片name 数组
        var updataArr = [
            'face',
            'idCardFaceImg',
            'idCardBackImg',
            'fullDriverIdCardImg',
            'drivingLicenceHomeImg',
            'drivingLicenceSubImg',
            'networkCarCertificationImg',
            'transLicenseImg',
            'drivingPic',
            'drivingPicBack',
            // 'compulsoryInsuranceImg',
            // 'commercialInsuranceImg',
            'carAngle45Img'
        ];

        function eachUpdataArr(updataArr) {
            for (var i = 0; i < updataArr.length; i++) {
                var inu = updataArr[i];
                updataFile(inu)
                if ($('input[name=' + updataArr[i] + ']').val() !== '') {
                    $('#' + updataArr[i] + ' .file-img-bk').hide()
                }
            }
        }

        eachUpdataArr(updataArr)

    })
</script>
<script type="text/javascript">
    //给身份证添加校验格式
    /*
     $.validator.addMethod("license", function(value, element) {
     return this.optional( element ) || /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/.test( value );
     }, '请填写与身份证一致的18位驾驶证号');
     */
    // 第一步
    var firstValidator = $('.step-first').validate();
    $(".frist-step-btn").click(function () {
        if (firstValidator.form()) {
            $('[name="licenseNum"]').val($('[name="idCard"]').val());
            if (haveCar == '1') {
                $('.step-apply-area').removeClass('visible');
                $('.step-apply-second').addClass('visible');
                $("html,body").animate({
                    scrollTop: 0
                }, 500);
                return false;
            }
            register()
        }
    });
    // 第二步
    var secondValidator = $('.step-second').validate();
    $(".second-step-btn").click(function () {
        if (secondValidator.form()) {
            register()
            return false;
        }
    });

    function register() {
        var params = {};
        // 遍历获取第一步骤填写的数据
        $('form[name="step-first"]').find('[type="hidden"],[type="text"],[type="select"]').each(function () {
            var t = $(this);
            params[t.attr('name')] = t.val();
        })
        if (haveCar == '1') {
            //  遍历获取第二步骤填写的数据
            $('form[name="step-second"]').find('[type="hidden"],[type="text"],[type="select"]').each(function () {
                var t = $(this);
                params[t.attr('name')] = t.val();
            })
            // 默认车辆所有人是注册司机
            params.ownerName = params.name
            params.ownerNameMobile = params.mobile
        }
        if (!!getQueryString('inviter')) {
            params['inviter'] = getQueryString('inviter') || '';
            params['inviterType'] = getQueryString('inviterType') || '';
        }
        // 是否是带车加入
        params.haveCar = haveCar
        // 获取驾驶证日期
        var getDriverLicenseDate = $('#getDriverLicenseDate')
        params.getDriverLicenseDate = new Date(getDriverLicenseDate.attr('data-year'), getDriverLicenseDate.attr('data-month'), getDriverLicenseDate.attr('data-day')).getTime()
        $.ajax({
            url: base + "/admin/driver/addRegister",
            data: params,
            type: 'POST',
            async: false,
            success: function (data) {
                $("#know-btn").attr("disabled", false);
                if (data.success) {
                    $('.ui-toastr-layer').removeClass('hide');
                    //location.href = basePath + "h5/driver/check?appid="+appid+"&mobile="+mobile + "&type=" +type;
                } else {
                    $(".sure-btn").attr("disabled", false);
                    $.toastr.error("注册失败，错误信息：" + data.msg);
                }
            },
            error: function (e) {
                $("#know-btn").attr("disabled", false);
                $(".sure-btn").attr("disabled", false);
                $.toastr.error("操作失败");
            }
        });
    }

    $('#iknow-btn').click(function () {
        $('.ui-toastr-layer').addClass('hide');
        location.reload()
    })
    $('.ui-back-btn').click(function () {
        $('.step-apply-area').removeClass('visible');
        $($(this).attr('data-step')).addClass('visible');
    })
    // //鼠标点击输入框，提示文本清除
    // //获取上传图片地址
    // $('.file-img').click(function() {
    // 	if ($('.file-img').has('img').length = 1) {
    // 		$('.file-img .error').text('');
    // 	}
    // });

    // $("#know-btn").click(function() {
    // 	if ($("#know-btn").attr("disabled") == "disabled") {
    // 		return;
    // 	}
    // 	if (!!getQueryString('inviter')) {
    // 		parem['inviter'] = getQueryString('inviter') || '';
    // 		parem['inviterType'] = getQueryString('inviterType') || '';
    // 	}

    // 	console.log(parem);
    // 	$("#know-btn").attr("disabled", true);
    // 	$.ajax({
    // 		url: "${base}/admin/driver/addRegister",
    // 		data: parem,
    // 		type: 'POST',
    // 		async: false,
    // 		success: function(data) {
    // 			$("#know-btn").attr("disabled", false);
    // 			if (data.success) {
    // 				$('.ui-toastr-layer').removeClass('hide');
    // 				//location.href = basePath + "h5/driver/check?appid="+appid+"&mobile="+mobile + "&type=" +type;
    // 			} else {
    // 				$(".sure-btn").attr("disabled", false);
    // 				$.toastr.error("注册失败，错误信息：" + data.msg);
    // 			}
    // 		},
    // 		error: function(e) {
    // 			$("#know-btn").attr("disabled", false);
    // 			$(".sure-btn").attr("disabled", false);
    // 			$.toastr.error("操作失败");
    // 		}
    // 	});
    // })

    // //确认信息
    // $(".submit-btn").click(function() {
    // 	window.scrollTo(0, 0);
    // 	// $('.ui-toastr-layer').removeClass('hide');
    // });

    // $('#iknow-btn').click(function() {
    // 	if (!!getQueryString('inviter')) { //含又邀请人参数和邀请人类型，操作回退
    // 		window.location.href =
    // 			'${base}/h5/driver/register?appid=${appid}&agentUuid=${agentUuid}&companyUuid=${companyUuid}&type=${type}&mobile=${mobile}&inviter=' +
    // 			(getQueryString('inviter') || '') + '&inviterType=' + (getQueryString('inviterType') || '');
    // 		return;
    // 	}
    // 	$('.ui-toastr-layer').hide();
    // 	var isIOS = navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
    // 	if (isIOS) { //IOS
    // 		window.webkit.messageHandlers.fallback1.postMessage('');
    // 	} else { //安卓
    // 		fallback.fallback();
    // 	}
    // 	$('.ui-toastr-layer').removeClass('hide');
    // })
</script>
<script>
    // 所属区域代理数据请求
    function areaRequest() {
        $.ajax({
            url: base + '/admin/driver/listAgent',
            type: 'POST',
            dataType: 'JSON',
            data: {
                "appid": appid,
                "businessType": businessType
            },
        })
            .done(function (res) {
                if (res.success) {
                    areaHtml(res.data)
                    $('#agentUuid').change();
                } else {
                    $.toastr.error(res.msg);
                }
            })
            .fail(function (err) {
                console.log("error");
            });
    }

    // 所属区域代理渲染
    function areaHtml(list) {
        var html = '';
        var htmls = ['<option value="" style="display: none;color: #a8abaf" disabled selected>----请选择----</option>'];
        list.forEach(function (item, index, arr) {
            var agentUuid = "${driverCheckDto.agentUuid}" || "${agentUuid}";
            if (agentUuid == item.uuid) {
                html = '<option selected value="' + item.uuid + '">' + item.name + '</option>';
                companyRequset(item.uuid)
                $('#agentUuid').attr("disabled", true);
            } else {
                html = '<option value="' + item.uuid + '">' + item.name + '</option>';
            }
            htmls.push(html)
        })
        htmls.push('<option></option>')
        $('#agentUuid').html(htmls)
    }

    // 所属公司数据请求
    function companyRequset(agentUuid) {
        $.ajax({
            url: base + '/admin/driver/listCompany',
            type: 'POST',
            dataType: 'JSON',
            data: {
                "appid": appid,
                "agentUuid": agentUuid,
                "businessType": businessType
            },
        })
            .done(function (res) {
                if (res.success) {
                    companyHtml(res.data)
                } else {
                    companyHtml([]);
                    $.toastr.error(res.msg);
                }
            })
            .fail(function (err) {
                console.log("error");
            });
    }

    // 所属车型查询
    function queryCarModel() {
        $.ajax({
            url: base + '/admin/driver/queryCarModel',
            type: 'POST',
            dataType: 'JSON',
            data: {
                "businessType": businessType
            },
        })
            .done(function (res) {
                if (res.success) {
                    carModelHtml(res.data)
                } else {
                    carModelHtml([]);
                    $.toastr.error(res.msg);
                }
            })
            .fail(function (err) {
                console.log("error");
            });
    }

    function carModelHtml(list) {
        var html = '';
        var htmls = [];
        list.forEach(function (item, index, arr) {
            var carModelUuid = "${driverCheckDto.carModelUuid}";
            if (carModelUuid == item.carModelUuid) {
                html = '<option selected value="' + item.carModelUuid + '">' + item.carModelName + '</option>';
            } else {
                html = '<option value="' + item.carModelUuid + '">' + item.carModelName + '</option>';
            }
            htmls.push(html);
        });
        $('#carModelUuid').html(htmls)
    }

    // 公司数据渲染
    function companyHtml(list) {
        var html = '';
        var htmls = ['<option value="" style="display: none;color: #a8abaf" disabled selected>----请选择----</option>'];
        list.forEach(function (item, index, arr) {
            var companyUuid = "${driverCheckDto.companyUuid}" || "${companyUuid}";
            if (companyUuid == item.uuid) {
                html = '<option selected value="' + item.uuid + '">' + item.shortName + '</option>';
                $('#companyUuid').attr("disabled", true);
            } else {
                html = '<option value="' + item.uuid + '">' + item.shortName + '</option>';
            }
            htmls.push(html);
        });
        $('#companyUuid').html(htmls)
    }

    (function () {
        // 区域信息变动监听
        $(document).on('change', '#agentUuid', function (e) {
            companyRequset($(this).val())
            $('#companyUuid').attr("disabled", false);
        })
        // 初始化区域信息
        areaRequest();
        queryCarModel();
    })()

    // 所属省份查询
    function provinceModel() {
        $.ajax({
            url: base + '/province/list',
            type: 'POST',
            dataType: 'JSON',
            data: {},
        }).done(function (res) {
            if (res.success) {
                provinceHtml(res.data)
                $('#provinceid').change();
            } else {
                provinceHtml([]);
                $.toastr.error(res.msg);
            }
        })
            .fail(function (err) {
                console.log("error");
            });
    }

    function provinceHtml(list) {
        var html = '';
        var htmls = ['<option value="" style="display: none;color: #a8abaf" disabled selected>----请选择----</option>'];
        list.forEach(function (item, index, arr) {
            var provinceid = "${driverCheckDto.provinceid}";
            if (provinceid == item.provinceID) {
                html = '<option selected value="' + item.provinceID + '">' + item.province + '</option>';
                $('#provinceid').attr("disabled", true);
            } else {
                html = '<option value="' + item.provinceID + '">' + item.province + '</option>';
            }
            htmls.push(html);
        });
        $('#provinceid').html(htmls)
    }

    (function () {
        // 省份信息变动监听
        $(document).on('change', '#provinceid', function (e) {
            cityRequset($(this).val())
            $('#cityid').attr("disabled", false);
        })
        // 初始化区域信息
        provinceModel();
    })()

    // 所属城市数据请求
    function cityRequset(provinceid) {
        var id = provinceid;
        if(provinceid == "" || provinceid == null) {
            if(provinceidStart) {
                id = provinceidStart;
            }else {
                id = 0
            }
        }
        $.ajax({
            url: base + '/province/city/list?provinceid='+id,
            type: 'get',
        }).done(function (res) {
            if (res.success) {
                cityHtml(res.data)
            } else {
                cityHtml([]);
                $.toastr.error(res.msg);
            }
        })
            .fail(function (err) {
                console.log("error");
            });
    }

    function cityHtml(list) {
        var html = '';
        var htmls = ['<option value="" style="display: none;color: #a8abaf" disabled selected>----请选择----</option>'];
        list.forEach(function (item, index, arr) {
            var cityid = "${driverCheckDto.cityid}";
            if (cityid == item.cityID) {
                html = '<option selected value="' + item.cityID + '">' + item.city + '</option>';
                $('#cityid').attr("disabled", true);
            } else {
                html = '<option value="' + item.cityID + '">' + item.city + '</option>';
            }
            htmls.push(html);
        });
        $('#cityid').html(htmls)
    }

</script>
</body>
</html>

